home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-06-15 | 443 b | 15 lines | [TEXT/DWat] |
- % Calculate the linear correlation coefficient (Pearson's r)
- % for the x and y vectors and store in the variable "r_cc"
- %
- % SUM( (x - mean(x)) - (y - mean(y)) )
- % r_cc = ____________________________________
- % SQRT(sum((x - mean(x))^2)) SQRT(sum((y - mean(y))^2))
- %
- rpn <x mean - <y mean - * sum
- set r_cc v0(1)
- rpn <x mean - dup * sum
- set r_cc r_cc v0(1) sqrt /
- rpn <y mean - dup * sum
- set r_cc r_cc v0(1) sqrt /
-
- close